﻿using System;
using NUnit.Framework;

namespace IAD13.fromTDDtoBDD.BDD
{
    [TestFixture]
    public abstract class Context<T>
    {
        protected T sut;
        protected Context()
        {
            Given();
            When();
        }

        protected virtual void Given() { }
        protected virtual void When() { }

        protected T Catch<T>(Action action) where T : Exception
        {
            try
            {
                action();
            }
            catch (T e)
            {
                return e;
            }
            return null;
        }

    }

    public class ThenAttribute : TestAttribute
    {
    }
}